"""一组用于表示燃油汽车和电动汽车的类"""
class Car():
    """一次模拟汽车的简单尝试"""
    def __init__(self, make, model, year):
        """初始化描述汽车的属性"""
        self.make = make
        self.model = model
        self.year = year
        self.odometer_reading = 0
    def get_descriptive_name(self):
        """返回整洁的描述性名称"""
        long_name = str(self.year) + " " + self.make + " " +self.model
        return long_name.title()
    def read_odometer(self):
        """打印一条信息，指出汽车的里程"""
        print("this car has " + str(self.odometer_reading) + " miles on it.")
    def update_odometer(self,mileage):
        """将里程表读数设置为指定的值，拒绝将里程表往回拨"""
        if mileage>= self.odometer_reading:
            self.odometer_reading = mileage
        else:
            print("you can't roll back an dodmeter!")
    def increment_ododmeter(self, miles):
        """将里程表读数增加指定的量"""
        self.odometer_reading += miles

		
